package com.kma.summer2012.client.events.request;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsRequest;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: EUGENE
 * Date: 2/20/13
 * Time: 12:13 AM
 * To change this template use File | Settings | File Templates.
 */
public class RequestsSelectedEvent extends GwtEvent<RequestsSelectedEvent.RequestSelectedEventHandler> {
    private static Type<RequestSelectedEventHandler> TYPE = new Type<RequestSelectedEventHandler>();

    public List<UICrumbsRequest> requests;
    public Integer tableID;

    public RequestsSelectedEvent(List<UICrumbsRequest> list, Integer tableID) {
        this.requests = list;
        this.tableID = tableID;
    }

    @Override
    public Type<RequestSelectedEventHandler> getAssociatedType() {
        return TYPE;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public static Type<RequestSelectedEventHandler> getType() {
        return TYPE;
    }

    @Override
    protected void dispatch(RequestSelectedEventHandler requestSelectedEventHandler) {
        requestSelectedEventHandler.onRequestsSelected(this);
    }

    public interface RequestSelectedEventHandler extends EventHandler {
        void onRequestsSelected(RequestsSelectedEvent event);
    }
}
